<script setup lang="ts">
import { Button } from 'ant-design-vue'
interface IProps {
  list: Record<string, any>
}
const props = defineProps<IProps>()
const openDir = (item) => {
  location.replace(item.dir)
}
</script>

<template>
  <div>
    <div v-for="item in list" class="z-flex-row z-items-center">
      <div>
        {{ item.status === 'added' ? '✅' : '' }}{{ item.status === 'deleted' ? '❌' : '' }}
      </div>
      <div v-if="item.status === 'added'" style="color: darkgreen; padding: 0 5px">[新增]</div>
      <div v-if="item.status === 'deleted'" style="color: red; padding: 0 5px">[删除]</div>
      <div class="z-flex1 g-text-ellipsis" :title="item.dir">{{ item.dir }}</div>
      <Button v-if="item.status === 'added'" type="text" @click="openDir(item)">打开</Button>
      <!--<div>{{item.time}}</div>-->
    </div>
  </div>
</template>

<style scoped></style>
